;; supercollider/constant.scm - (c) rohan drape, 2003-2005

;; A <constant> represents a constant real number in a UGen graph.

(define-structure constant (value index))

;; Make a new constant object for `value'.

(defineV make-constant 
  (lambdaK ((value 0) (index #f)) (make-constant* value index)))

;; Make a copy of the <constant> value `c' with the given <integer>
;; index.

(define (constant/index c index)
  (make-constant (constant-value c) index))

;; Return an <input> value to represent the closed <constant> value
;; `c'.

(define (constant->input c)
  (make-input -1 (constant-index c)))
